package com.ssy.wireless.web.vo.req;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
public class PortalQueryVo {
    private String area;
    private String hotspotName;
    private String name;
    private String uploadBeginTime;
    private String uploadEndTime;

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getHotspotName() {
        return hotspotName;
    }

    public void setHotspotName(String hotspotName) {
        this.hotspotName = hotspotName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUploadBeginTime() {
        return uploadBeginTime;
    }

    public void setUploadBeginTime(String uploadBeginTime) {
        this.uploadBeginTime = uploadBeginTime;
    }

    public String getUploadEndTime() {
        return uploadEndTime;
    }

    public void setUploadEndTime(String uploadEndTime) {
        this.uploadEndTime = uploadEndTime;
    }

    public Map<String, Object> queryParams() {
        Map<String, Object> params = new HashMap();
        params.put("hotspotName", StringUtils.hasLength(this.getHotspotName()) ? "%" + this.getHotspotName() + "%" : null);
        params.put("imgName", StringUtils.hasLength(this.getName()) ? "%" + this.getName() + "%" : null);
        params.put("area", StringUtils.hasLength(this.getArea()) ? "%" + this.getArea() + "%" : null);
        params.put("uploadBeginTime", StringUtils.hasLength(this.getUploadBeginTime()) ? this.getUploadBeginTime() + " 00:00:00" : null);
        params.put("uploadBeginTime", StringUtils.hasLength(this.getUploadEndTime()) ? this.getUploadEndTime() + " 23:59:59" : null);
        return params;
    }
}
